cmake_minimum_required( VERSION 2.8 )
project( vo )

set( CMAKE_CXX_COMPILER g++ )
set( CMAKE_BUILD_TYPE "Debug")
set( CMAKE_CXX_FLAGS "-std=c++11" )

list( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules )
set( EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin )
set( LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib )

#opencv
find_package( OpenCV 3.1 REQUIRED )
include_directories( ${OpenCV_INCLUDE_DIRS} )
#G2O
find_package( G2O REQUIRED )
find_package( CSparse REQUIRED )
include_directories( ${G2O_INCLUDE_DIRS} ${CSPARSE_INCLUDE_DIR} )
#Eigen
include_directories( "/usr/include/eigen3" )
#Sophus
find_package( Sophus REQUIRED )
include_directories( ${Sophus_INCLUDE_DIRS} )
#Ceres
find_package( Ceres REQUIRED )
include_directories( ${CERES_INCLUDE_DIRS} )

set( THIRD_PARTY_LIBS 
	${OpenCV_LIBS}
	${Sophus_LIBRARIES}
	${CSPARSE_LIBRARY}
	${CERES_LIBRARIES}
	g2o_core g2o_stuff g2o_types_sba g2o_csparse_extension
)


include_directories( ${PROJECT_SOURCE_DIR}/include )
add_subdirectory( src )
add_subdirectory( test )
